<?php

/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/**
 * Description of showStatistik
 *
 * @author christiangreweling
 */
class Zend_View_Helper_ShowAnalyticalLines extends Zend_View_Helper_Abstract {

    //put your code here


    public function showAnalyticalLines($user = null, $color = null, $lines = null) {
        if ($lines != null) {



            $points = $this->view->translate('Points');
            $html = '';


            $html.='<script>';

            $html.='
        $(document).ready(function(){
            var userLabels = '.$user.';
            var userColors = '.$color.';
            var lines = '.$lines.';


            var plot2 = $.jqplot("analyticaltLines", lines , {
            title:"'.$points.'", 
            seriesColors: userColors,
            gridPadding:{right:35},
            axes:{
            xaxis:{
            renderer:$.jqplot.DateAxisRenderer, 
            tickOptions:{formatString:" %#d. %b"},
            min:"Jan 1, 2012", 
            tickInterval:"1 month"
            }
            },
            grid:{
            background: "transparent",
            borderWidth: 1.0
            },
            series:[{lineWidth:4, markerOptions:{style:"square"}}],
            legend: {
            show: true,
            location: "nw",     // compass direction, nw, n, ne, e, se, s, sw, w.
            xoffset: 12,        // pixel offset of the legend box from the x (or x2) axis.
            yoffset: 12,        // pixel offset of the legend box from the y (or y2) axis.
            labels: userLabels
            }                
            });
        })
';

            $html.= '</script>';

            $html.='<div id="analyticaltLines" >  </div>';
        }





        return $html;
    }

}

?>